package com.mrx.pvzcommunity.controller;

import com.mrx.pvzcommunity.model.Result;
import com.mrx.pvzcommunity.model.SiteInfo;
import com.mrx.pvzcommunity.service.SiteInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@Api(tags = "网站统计信息")
@CrossOrigin(originPatterns = "*", allowCredentials = "true")

public class SiteInfoController {

    private final SiteInfoService siteInfoService;

    @GetMapping("/site")
    @ApiOperation(value = "查询站点信息", notes = "查询站点信息 API")

    public Result<SiteInfo> getSiteInfo() {
        return siteInfoService.getSiteInfo();
    }
}
